﻿using GameFramework.Resource;
using UnityGameFramework.Runtime;
using GameEntry = Fruits.Base.GameEntry;
using ProcedureOwner = GameFramework.Fsm.IFsm<GameFramework.Procedure.IProcedureManager>;

namespace Fruits.Procedure
{
    public class ProcedureSplash : ProcedureBase
    {
        public override bool UseNativeDialog => true;
        
        protected override void OnUpdate(ProcedureOwner procedureOwner, float elapseSeconds, float realElapseSeconds)
        {
            base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds);
            
            //  TOOD: 过度动画
            
            //  资源编辑器模式
            if (GameEntry.Base.EditorResourceMode)
            {
                Log.Info("Editor resource mode detected.");
                ChangeState<ProcedurePreload>(procedureOwner);
            }
            else
            {
                Log.Info("Updatable resource mode detected.");
                ChangeState<ProcedureCheckVersion>(procedureOwner);
            }
        }
    }
}